package com.blink.optimize.apis.clone;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * <ClassName>Credit</ClassName>
 * <Description></Description>
 *
 * @Author liuxianzhao
 * @Date 2018年01月06日 11:24
 */
public class Credit implements Cloneable {
    private String name;
    private String address;
    private Integer age;
    private User user;
    private ArrayList<String> items;
    private HashMap<String, String> couples;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Credit credit = (Credit) super.clone();
        credit.setUser((User) user.clone());
        credit.setItems((ArrayList<String>) items.clone());
        credit.setCouples((HashMap<String, String>) couples.clone());
        return credit;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public ArrayList<String> getItems() {
        return items;
    }

    public void setItems(ArrayList<String> items) {
        this.items = items;
    }

    public HashMap<String, String> getCouples() {
        return couples;
    }

    public void setCouples(HashMap<String, String> couples) {
        this.couples = couples;
    }

    public Credit() {
    }

    public Credit(String name, String address, Integer age, User user, ArrayList<String> items, HashMap<String, String> couples) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.name = name;
        this.address = address;
        this.age = age;
        this.user = user;
        this.items = items;
        this.couples = couples;
    }
}
